package rule

import (
	"ginpro/app/middleware/logger"
	"net/http"

	"github.com/gin-gonic/gin"
)

var Rule = gin.Default()

func Router() *gin.Engine {
	logger.GinLogger()
	Rule.Use(logger.GinLogger()) // 应用中间件

	{
		v1 := Rule.Group("/v1")
		v1.GET("/login", func(c *gin.Context) {
			c.JSON(http.StatusOK, gin.H{"code": 200, "message": "ok"})
		})
	}
	return Rule
}
